<template>
  <div class="wutong-pool">
    <van-tabs v-model:active="active">
        <van-tab title="全部">
            <van-dropdown-menu>
                <van-dropdown-item title="时间" v-model="value1" :options="option1" />
                <van-dropdown-item title="类型" v-model="value2" :options="option2" />
            </van-dropdown-menu>
            <approval-list :approvalList = approvalZlist />
        </van-tab>
        <van-tab title="待审核">
            <van-dropdown-menu>
                <van-dropdown-item title="时间" v-model="value1" :options="option1" />
                <van-dropdown-item title="类型" v-model="value2" :options="option2" />
            </van-dropdown-menu>
          <approval-list :approvalList = approvalDshlist />
        </van-tab>
        <van-tab title="已审核">
            <van-dropdown-menu>
                <van-dropdown-item title="时间" v-model="value1" :options="option1" />
                <van-dropdown-item title="类型" v-model="value2" :options="option2" />
            </van-dropdown-menu>
          <approval-list :approvalList="approvalYshlist" />
        </van-tab>
    </van-tabs>
  </div>
</template>

<script setup>
import { ref, watch, toRefs, onMounted } from 'vue';
import { getCompanyList,getTalentList } from '@/api/company.js';
import { useRouter,useRoute } from 'vue-router';
const active = ref(0);
const route = useRoute();

var statusActive = route.query.status || '';

if(statusActive == 0){
  active.value = 0
}else if(statusActive == 1){
  active.value = 1
} else if(statusActive == 2){
  active.value = 2
}

const value1 = ref(0);
const value2 = ref('a');
const option1 = [
    { text: '近半年', value: 0 },
    { text: '近三月', value: 1 },
    { text: '近一月', value: 2 },
];
const option2 = [
    { text: '类型', value: 'a' },
    { text: '类型2', value: 'b' },
    { text: '类型3', value: 'c' },
];

const router = new useRouter();

//  页面跳转
const jump = (options) => {
  router.push(options);
}

//总数
const approvalZlist = ref([])
const getTalent = async () => {
  const { code, data } = await getTalentList({
    currentPage: 1,
    pageSize: 20,
    // companyId: "91321200MACTU4PJ4N",
  });
  if (code === 200) {
    approvalZlist.value = data.list;
  }
}

//待审核
const approvalDshlist = ref([])
const getDshTalent = async () => {
  const { code, data } = await getTalentList({
    currentPage: 1,
    pageSize: 20,
    // companyId: "91321200MACTU4PJ4N",
    auditStatus: '0'
  });
  if (code === 200) {
    approvalDshlist.value = data.list;
  }
}

//已审核
const approvalYshlist = ref([])
const getYshTalent = async () => {
  const { code, data } = await getTalentList({
    currentPage: 1,
    pageSize: 20,
    // companyId: "91321200MACTU4PJ4N",
    auditStatus: '1'
  });
  if (code === 200) {
    approvalYshlist.value = data.list;
  }
}

onMounted(() => {
  getTalent()
  getDshTalent()
  getYshTalent()
})

</script>

<style lang="scss" scoped>
.wutong-pool {
  box-sizing: border-box;
  height: 100%;
  background: #FAFAFC;

  .header-intro{
    background: #fff;
    padding: 2rem;
    border-top: 1px solid #F2F2F4;
    margin-bottom: 1.2rem;

    .intro{
      display: flex;
      align-items: flex-start;
      justify-content: space-between;

      .dv-left{

          .cname{
              font-size: 1.8rem;
              font-weight: 600;
              color: #333333;
              font-family: '微软雅黑';
          }
          .phone{
              font-size: 14px;
              font-weight: 400;
              margin-top: 1rem;
              color: #666666;
          }
      }
      .dv-right{
          width: 8.5rem;
          height: 3.3rem;
          background: #1052CC;
          align-items: center;
          display: flex;
          justify-content: space-around;
          font-size: 1.4rem;
          font-weight: 400;
          color: #fff;

          .add{
              width: 1.4rem;
          }
      }
      .addry,.addry1{
        width: 27.6rem;
        height: 4.7rem;
        line-height: 4.7rem;
        border-radius: 5px;
        border: 1px solid #E5E5E5;
        text-align: center;
        margin: 0 auto 1.5rem;
      }
      .addry1{
        margin-top: 3rem;
        margin-bottom: 1rem;
      }
    }
    .address{
        font-size: 14px;
        font-weight: 400;
        margin-top: 1rem;
        color: #666666;
    }
  }
}
::v-deep .van-dialog__cancel{
  display: none;
}

</style>